package com.example.Extension.Event;

import com.example.Extension.commons.Color;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.stereotype.Component;

/**
 * @Description TODO
 * @Date 2024/6/3 13:30
 * @Created by houjunfeng
 */
@Component
public class Publish {
    @Autowired
    public ApplicationContext applicationContext;

    public void publish(){
        Color color = new Color();
        applicationContext.publishEvent(new MyEvent(this,color));
    }
}
